<?php
namespace Admin\Controller;
use Think\Controller;
class ArticleController extends BaseController {

	public function index(){
		$article_list = M('article')->field(true)->select();
		$type_name = array (
			'0' => '日记',
			'1' => '杂谈',
			'2' => '隐私'
			);
		$this->assign('article_list', $article_list);
		$this->assign('type_name', $type_name);
		$this->display();
		
	}

	public function delete () {

		$id = I('get.id');
		$article = M('article');
		
		$i=$article->delete($id);
		
		if($i==1){
			$this->success('删除成功','/admin/article');
		}else{
			$this->error('删除失败');
		}
	}

    public function gogogo () {
    	
    }
	
